﻿<navigation:Page x:Class="LEEAAttendanceControl.Views.SpecificShiftsAssignments"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480">
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <LinearGradientBrush x:Key="BackRectangleBrush" EndPoint=".7,1" StartPoint=".7,0">
                <GradientStop Color="#FCFFFFFF" Offset="0.015"/>
                <GradientStop Color="#F7FFFFFF" Offset="0.375"/>
                <GradientStop Color="#E5FFFFFF" Offset="0.6"/>
                <GradientStop Color="#D1FFFFFF" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel Orientation="Vertical">
                <Grid Background="#404041">
                    <TextBlock x:Name="ShAssignmentsBlock" Text="Shift Assignments" FontSize="14" FontWeight="Bold"
                               Foreground="White" Margin="5,3,3,2"/>
                </Grid>

                <riaControls:DomainDataSource x:Name="ShiftsDataSource" AutoLoad="True" QueryName="GetShiftDays"
                                              LoadingData="ShiftsDataSource_LoadingData">
                    <riaControls:DomainDataSource.DomainContext>
                        <my:LEEAContext />
                    </riaControls:DomainDataSource.DomainContext>
                </riaControls:DomainDataSource>

                <sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True"
                              ItemsSource="{Binding Data, ElementName=ShiftsDataSource}">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTemplateColumn Header="Shift Name" CanUserReorder="False" Width="126"
                                                    CanUserResize="False">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <sdk:Label Content="{Binding ShiftName}" HorizontalAlignment="Left" Height="23"
                                                   Margin="5,0,0,0" VerticalAlignment="Center"
                                                   Foreground="{Binding ForeColor}"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn Header="From" CanUserReorder="False" Width="111" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <sdk:Label Content="{Binding From, StringFormat='dd/MM/yyyy'}"
                                                   HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center"
                                                   Foreground="{Binding ForeColor}"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn Header="To" CanUserReorder="False" Width="111" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <sdk:Label Content="{Binding To, StringFormat='dd/MM/yyyy'}"
                                                   HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center"
                                                   Foreground="{Binding ForeColor}"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Sat" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Saturday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Sun" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Sunday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Mon" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Monday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Tues" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Tuesday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Wed" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Wednesday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Thur" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Thursday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn CanUserReorder="False" Width="65" CanUserResize="False">
                            <sdk:DataGridTemplateColumn.HeaderStyle>
                                <Style TargetType="sdk:DataGridColumnHeader">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Grid>
                                                    <Rectangle Fill="#FF1F3B53" Stretch="Fill"/>

                                                    <Rectangle Stretch="Fill" Fill="{StaticResource BackRectangleBrush}"/>

                                                    <Rectangle Fill="#FFC9CACA" VerticalAlignment="Stretch"
                                                                                   Width="1" HorizontalAlignment="Right"/>

                                                    <TextBlock Text="Fri" HorizontalAlignment="Center"
                                                                                   VerticalAlignment="Center"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </sdk:DataGridTemplateColumn.HeaderStyle>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid Margin="0" Background="{Binding Color}">
                                        <Ellipse Width="8" Height="8" Fill="{Binding ForeColor}" Opacity="{Binding Friday}"
                                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</navigation:Page>
